package com.chenjun.mysite.module.sys.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MenuCategoryController extends HttpServlet
{

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -2269649796035524600L;
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	{
		doPost(request,response);
	}
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
	{
		String action = request.getParameter("action");
		switch(action)
		{	
			case "list":
				this.list(request, response);
				break;
			case "form":
				this.form(request, response);
				break;
		}
	}
	
	public void list(HttpServletRequest request, HttpServletResponse response)
	{
		try
		{
			request.getRequestDispatcher("/WEB-INF/views/sys/menuCategoryList.jsp").forward(request, response);
		}
		catch (ServletException e)
		{
			e.printStackTrace();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
		
	}
	
	public void form(HttpServletRequest request, HttpServletResponse response)
	{
		
	}
	
}
